package com.cy.controller;

import com.cy.common.entity.Result;
import com.cy.service.UserVocabularyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @Author : 残影
 * @Date: 2021-02-27 11:28
 */
@RestController
@RequestMapping("/userVocabulary")
@Api(tags = "用户词汇模块")
public class UserVocabularyController {
    @Autowired
    private UserVocabularyService userVocabularyService;
    @ApiOperation("根据书本id和章节名称加入我的学习词汇中")
    @PostMapping("/addStudy")
    public Result addStudy(@RequestParam String bookId, @RequestParam String tag,
                           @RequestParam Long userId){
        int i = userVocabularyService.addStudy(bookId,tag,userId);
        return Result.ok("添加成功");
    }
}
